from aiogram import Dispatcher
from aiogram.filters import Command

from poker_bot.config import Settings
from poker_bot.tg_bot.keyboards.inline import AccountCF, DepositCF, WithdrawCF

from .account import go_to_account_handler
from .deposit import go_to_deposit_handler
from .errors import setup_error_handlers
from .start import user_start
from .withdraw import go_to_withdraw_handler


def register_handlers(dp: Dispatcher, config: Settings):
    dp.message.register(user_start, Command(commands="start"))
    dp.callback_query.register(go_to_deposit_handler, DepositCF.filter())
    dp.callback_query.register(go_to_account_handler, AccountCF.filter())
    dp.callback_query.register(go_to_withdraw_handler, WithdrawCF.filter())
    setup_error_handlers(dp, config.tg_bot.developer_id)
